//
//  CommentView.swift
//  甜言蜜语
//
//  Created by 王剑伟 on 16/5/26.
//  Copyright © 2016年 wl. All rights reserved.
//

import UIKit

class CommentView: UIView {

    /*
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func drawRect(rect: CGRect) {
        // Drawing code
    }
    */
    @IBOutlet weak var textField: UITextField!
    
    static func create() -> CommentView {
        let view = NSBundle.mainBundle().loadNibNamed("CommentView", owner: nil, options: nil).last as! CommentView
        
        let screenBounds:CGRect = UIScreen.mainScreen().bounds
        
        view.frame = CGRectMake(0, screenBounds.height, screenBounds.width, 71)
        
        return view
    }
    
    override func canBecomeFirstResponder() -> Bool {
        return true
    }
    
    override func becomeFirstResponder() -> Bool {
        super.becomeFirstResponder()
        
        return self.textField.becomeFirstResponder()
    }
    
    override func resignFirstResponder() -> Bool {
        super.resignFirstResponder()
        
        return self.textField.resignFirstResponder()
    }
}
